As the keyboard is released asynchronously after setting the ibus
engine, there's a possibility that the `this._reloading` property
changed in the meantime.
To ensure that `holdKeyboard()` and `releaseKeyboard()` are correctly
paired, record the condition in a local variable so that it maintains
its value in the callback.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3476>
// E.g. Focusing on a password entry in a popup in Xorg Firefox
// will emit 'set-content-type' signal.
// https://gitlab.gnome.org/GNOME/gnome-shell/issues/391
- if (!this._reloading)
+ const holdKeyboard = !this._reloading;
+ if (holdKeyboard)
KeyboardManager.holdKeyboard();
this._keyboardManager.apply(is.xkbId);
engine = 'xkb:us::eng';
this._ibusManager.setEngine(engine).then(() => {
- if (!this._reloading)
+ if (holdKeyboard)
KeyboardManager.releaseKeyboard();
});